/* 基础样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background-color: #f5f5f5;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  vertical-align: middle;
  border-style: none;
}

input, button {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
  background: none;
}

/* 布局容器 */
.app-container {
  max-width: 100%;
  margin: 0 auto;
  padding-bottom: 50px; /* 为底部导航留出空间 */
}

/* 搜索栏 */
.search-bar {
  padding: 10px 15px;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-box {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border-radius: 20px;
  padding: 8px 15px;
  transition: all 0.3s;
}

.search-box:active {
  background: #e5e5e5;
}

.search-icon {
  margin-right: 8px;
  color: #666;
  font-size: 16px;
}

.search-input {
  flex: 1;
  font-size: 14px;
  color: #333;
}

/* 商品网格 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 10px;
}

.product-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:active {
  transform: translateY(2px);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.product-image-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  overflow: hidden;
  background: #f9f9f9;
}

.product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-info {
  padding: 10px;
}

.product-title {
  font-size: 13px;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 36px;
  line-height: 18px;
}

.product-price {
  display: flex;
  align-items: baseline;
}

.product-current-price {
  color: #f03d3d;
  font-weight: bold;
  font-size: 16px;
}

.product-original-price {
  color: #999;
  font-size: 12px;
  text-decoration: line-through;
  margin-left: 5px;
}

.product-points {
  margin-top: 5px;
  font-size: 12px;
  color: #ff9500;
}

/* 加载更多 */
.load-more {
  text-align: center;
  padding: 15px;
  color: #666;
  font-size: 13px;
  background: white;
}

.load-more-btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 15px;
  background: #f5f5f5;
  color: #666;
}


.bottom-nav .nav-item {
  color: #666;
  transition: color 0.3s;
}

.bottom-nav .nav-item.active {
  color: #ff5e57 !important; /* 确保优先级 */
}

.bottom-nav .nav-item.active .nav-icon {
  color: #ff5e57 !important;
}
/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: white;
  display: flex;
  border-top: 1px solid #f0f0f0;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 10px;
}

.nav-item.active {
  color: #ff5e57;
}

.nav-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* 响应式调整 */
@media (min-width: 768px) {
  .app-container {
    max-width: 768px;
  }
  
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}